package com.mtons.mblog.web.controller.site;

import com.mtons.mblog.modules.data.HistoryVO;
import com.mtons.mblog.modules.service.HistoryService;
import com.mtons.mblog.web.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 历史的今天.
 * @author yuzhong
 * @date 2019/2/21 20:39
 */
@Controller
public class HistoryController extends BaseController {
    @Autowired
    private HistoryService historyService;

    @RequestMapping("/history")
    public String history(ModelMap model) {
        List<HistoryVO> historyVOList = historyService.findByToday();
        model.put("histories", historyVOList);
        return view(Views.HISTORY);
    }
}
